<{include file='public/head'}>
<div class="layui-body">
	<div class="layui-tab layui-tab-brief">
		  <ul class="layui-tab-title">
			<li class="layui-this"><a href="<{:url('index')}>"><{$MenuName}>列表</a></li>
			<li><a href="<{:url('add')}>"><{$MenuName}>添加</a></li>
		  </ul>
		  <div class="layui-tab-content">
				<form action="<{:url('index')}>" method="get" class="layui-form">
					<div class="layui-form-item nospace">
						 <div class="layui-input-inline">
							<input type="text" name="keyword" placeholder="请输入关键字" value="<{$UrlParam.keyword|default=''}>"  class="layui-input">
						 </div>
						 <div class="layui-input-inline">
							<button class="layui-btn" lay-submit>搜索</button>
						 </div>
					</div>
				</form>
				<form class="layui-form" id="contentForm" name="contentForm" method="post">
					<div class="page-module-table">
						<table class="layui-table">
							<thead>
							<tr>
								<th>
									<input type="checkbox" class="checkbox" lay-ignore id="checkall" title="全选">
								</th>
								<th>ID</th>
								<th>排序</th>
								<th>模型</th>
								<th>分类名称</th>
								<th>是否禁用</th>
								<th>操作</th>
							</tr>
							</thead>
							<tbody>
							 <{volist name="List" id="val"}>
								<tr>
									<td>
									 <input type="checkbox" class="checkbox checkitem" <{if condition="$val.Typeisxit eq 1"}> disabled="disabled"<{/if}> lay-ignore name="Del[]" value="<{$val.TypeID}>">
		                    		<input type="hidden" name="listall[]" value="<{$val.TypeID}>">
									</td>
									<td><{$val.TypeID}></td>
									<td class="table-input">
									 <input type="text" lay-ignore class="layui-input" name="sorting[]" value="<{$val.TypeSort}>">
									</td>
									<td>
									<{volist name="models" id="li"}>
									<{if condition="$li->mcode eq $val.TypeMcode"}>
										<{$li->name}>
									<{/if}>                   	
									<{/volist}>
									</td>
									 <td><{$val.TypeName}><{if condition="$val.count gt 0"}> <a class="" href="<{:url('index',array('PID'=>$val['TypeID']))}>"><i class="layui-icon"></i>下级类</a><{/if}></td>
									<td>
									<{if condition="$val.TypeState eq 1"}>
			                        <a href="<{:url('/wholetype/StateChange/id/'.$val.TypeID.'/value/0')}>"><i class='fa fa-toggle-on' title="点击关闭"></i></a>
			                        <{else}>
										<a href="<{:url('/wholetype/StateChange/id/'.$val.TypeID.'/value/1')}>"><i class='fa fa-toggle-off' title="点击开启"></i></a>
									<{/if}>
									</td>
									<td>
										<div class="layui-btn-group">
										<{if condition="$val.TypePID eq 0"}>
										 <a class="layui-btn layui-btn-xs" href="<{:url('add',array('id'=>$val['TypeID']))}>"><i class="layui-icon"></i>添加</a>
										 <{/if}>
										<a class="layui-btn layui-btn-xs" href="<{:url('edit',array('id'=>$val['TypeID']))}>"><i class="layui-icon"></i>编辑</a>
										<{if condition="$val.Typeisxit eq 1"}>
										<a class="layui-btn layui-btn-xs layui-btn-radius layui-btn-disabled">系统类</a>
										<{else}>										
										<a class="layui-btn layui-btn-xs layui-btn-danger" href="<{:url('del',array('id'=>$val['TypeID']))}>"><i class="layui-icon "></i>删除</a>
										<{/if}>

										</div>
									</td>
								</tr>
								<{/volist}>
							</tbody>
						</table>
						<button type="submit" name="submit" onclick="return setDelAction();" class="layui-btn layui-btn-danger">批量删除</button>
						<button type="submit" name="submit" onclick="return setsortAction();" class="layui-btn layui-btn-default">批量排序</button>
						<script>
			     			function setDelAction(){
			     				document.contentForm.action = "<{:url('del')}>"; 
			     				return confirm("您确定要删除选中的内容么？");
			     			}
							function setsortAction(){
			     				document.contentForm.action = "<{:url('sort')}>"; 
			     				return confirm("您确定要排序？");
			     			}
			     	</script>
					</div>
				</form>
		</div>
	</div> 
</div>
<{include file="public/foot"}>